define(["jquery"],function($){
	function comsty(){
		$("#search").focus(function(){
			$(this).val("");
			$(this).css("background","#fff");
		})
		$("#search").blur(function(){
			$(this).val("输入商品名/编号/拼音");
			$(this).css("background","#e0e0e0");
		})
		$(window).scroll(function(){
			if(document.documentElement.scrollTop > 100){
				$("#headerbox").css({"position":"fixed","top":"0","height":"45px"});
				$("#header").css({"height":"41px","padding-top":"4px"});
				$("#header h1").css("transform","scale(0.75)");
				$("#header #shopcar").css("transform","scale(0.8)");
				$("#header form").css({"width":"730px","padding-top":"3px"})
			}else{
				$("#headerbox").css({"position":"static","height":"78px"});
				$("#header").css({"height":"63px","padding-top":"15px"});
				$("#header h1").css("transform","scale(1)");
				$("#header #shopcar").css("transform","scale(1)");
				$("#header form").css({"width":"540px","padding-top":"0px"})
			}
			if(document.documentElement.scrollTop > 580){
				$("#fixed #top").css("display","block");
			}else{
				$("#fixed #top").css("display","none");
			}
		})
		$("#fixed #top").click(function(){
			$("html,body").animate({"scrollTop":"0"},500);
		})
		$("#citylist ul li").each(function(){
			$(this).hover(function(){
				var $index = $(this).index();
				$("#citylist ul li").removeClass("showlist");
				$(this).addClass("showlist");
				$("#citylist ul .list1").css("display","none");
				$("#citylist ul .list1").eq($index).css("display","block");
			})	
		})
		if($.cookie("login")){
			$("#tools #userlogin a").html("用户:" + $.cookie("login"));
			$("#tools #userrequire").css("display","none")
		}else{
			$("#tools #userlogin a").html("[登录]");
			$("#tools #userrequire").css("display","block")
		}
	}
	return {
		fn : comsty
	}
})